// ts 增强了class类

export {};

interface Option {
  name: string;
}

class Person {
  public readonly name: string = "张三"; // 任何时候都不能被修改
  constructor(option: Option) {
    this.name = option.name;
  }
  getName() {
    return this.name;
  }
  setName(name: string) {
    // this.name = name;
  }
}

let person = new Person({
  name: "李四",
});

console.log(person.getName);
